{% extends 'public/base.html' %}
{% block content %}
            <xblock><button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon">&#xe640;</i>批量删除</button><button class="layui-btn" onclick="level_add('添加管理员','{{ url_for('cms_bp.admin_add') }}','','800','550')"><i class="layui-icon">&#xe608;</i>添加</button><span class="x-right" style="line-height:40px;margin-right: 30px">共有数据：{{ data_s |count }} 条</span></xblock>
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>
                            <input type="checkbox" name="check_all" value=""> 全选
                        </th>
                        <th>
                            登录名
                        </th>
                        <th>拥有权限</th>
                        <th>
                            备注
                        </th>
                        <th>添加时间</th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                {% for data in data_s %}
                <tr>
                        <td>
                            <input type="checkbox" value="{{ data.id }}" name="checkbox"> ID:{{ data.id }}
                        </td>
                        <td>
                            {{ data.username }}
                        </td>
                    <td>{{ data.pro.authority_name }} </td>
                        <td >
                            {{ data.remark or '' }}
                        </td>
                    <td>{{ data.create_time }}</td>
                        <td class="td-manage">
                            <a style="text-decoration:none"
                           {% if data.status==1 %}onclick="member_stop(this,'{{ data.id }}',-1)"
                           {% else %}onclick="member_start(this,'{{ data.id }}',1)"{% endif %} href="javascript:;"
                           title="{% if data.status==1 %}停用{% else %}启用{% endif %}">
                            <i class="layui-icon">{% if data.status==1 %}&#xe601;{% else %}&#xe62f;{% endif %}</i>
                        </a>
                            <a title="删除" href="javascript:;" onclick="member_del(this,'{{ data.id }}')"
                            style="text-decoration:none">
                                <i class="layui-icon">&#xe640;</i>
                            </a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
    {% if page.pages>1 %}
    <div class="layui-card-body ">
        <div class="page">
            <div>
            <a {% if page.has_prev %}class="next" href="{{ url_for(url) }}?page={{ page.prev_num }}" {% else %}class="layui-btn-disabled"{% endif %}>上一页</a>
                {% for pg in page.iter_pages(2,2,2,2) %}
                    {% if page.page==pg %}
                        <span class="current">{{ pg }}</span>
                    {% else %}
                        {% if pg %}
                        <a class="num" href="{{ url_for(url) }}?page={{ pg }}">{{ pg }}</a>
                        {% endif %}
                    {% endif %}
                {% endfor %}
            {% if not page.pages==page.page %}
            <a class="num" href="{{ url_for(url) }}?page={{ page.pages }}">最后一页</a>
                {% endif %}
                <a {% if page.has_next %}class="next" href="{{ url_for(url) }}?page={{ page.next_num }}" {% else %}class="layui-btn-disabled"{% endif %}>下一页</a>
            </div>
        </div>
    </div>
    {% endif %}
{% endblock %}